/**
 * Project Name:design-pattern <br/>
 * File Name:DuckSortTestdrive.java <br/>
 * Package Name:com.ftu.study.pattern.template <br/>
 */
package com.ftu.study.pattern.template;

import java.util.Arrays;

/**
 * <p>  </p>
 * @version 1.0 2018年12月3日 mq 
 */
public class DuckSortTestdrive {
    public static void main(String[] args) {
        Duck[] ducks = {
                new Duck("Daffy", 8),
                new Duck("Dewey", 2),
                new Duck("hello", 5),
        };
        System.out.println("---before sort----");
        display(ducks);
        
        Arrays.sort(ducks);
        
        System.out.println("---after sort----");
        display(ducks);
    }
    
    static void display(Duck[] ducks) {
        for(int i = 0; i < ducks.length; i++) {
            System.out.println(ducks[i]);
        }
    }
}
